package cn.numeron.wandroid

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.navigation.findNavController
import cn.numeron.discovery.Discoveries
import cn.numeron.common.frame.GraphRegistrar
import cn.numeron.common.viewbinding.viewBinding
import cn.numeron.wandroid.databinding.ActivityHealthyBinding
import dagger.hilt.android.AndroidEntryPoint

@AndroidEntryPoint
class WandroidActivity : AppCompatActivity() {

    private val navController by lazy {
        findNavController(R.id.healthy_fragment_container)
    }

    private val viewBinding: ActivityHealthyBinding by viewBinding()

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(viewBinding.root)
        //加载各个可用模块中的导航资源
        Discoveries.getAllInstances<GraphRegistrar>().forEach {
            it.register(navController.graph, navController.navInflater)
        }
    }

}